<?php $type = $this->item->getType(); ?>


<?php if($type == 'image') : ?>
<div class="storytlr_image">
	<div  class="title entry-title p-name p-summary">
		<?= $this->item->getTitle();?>
	</div>
	<div class="entry-content e-content">
		<div class="content">
			<a href="<?= $this->item->getImageUrl('large'); ?>" title="<?= $this->item->getTitle(); ?>" target="_blank"><img src="<?= $this->item->getImageUrl('medium'); ?>" width="350"></a>
		</div>
		<?php if ($this->item->getDescription()) : ?>
		<div class="note">
			<?= $this->item->getDescription(); ?>
		</div>
		<?php endif ?>
	</div>
</div>
<?php elseif($type == 'audio') : ?>
<div class="storytlr_audio">
	<div  class="title entry-title p-name p-summary">
		<?= $this->item->getTitle(); ?>
	</div>
	<div class="entry-content e-content">
		<div class="content">
			<object type="application/x-shockwave-flash" data="flash/player_mp3.swf" width="200" height="20">
			     <param name="movie" value="flash/player_mp3.swf" />
			     <param name="wmode" value="transparent" />
			     <param name="FlashVars" value="mp3=<?= $this->item->getAudioUrl(); ?>" />
			</object>
		</div>
		<?php if ($this->item->getDescription()) : ?>
			<div class="note">
				<?= $this->item->getDescription(); ?>
			</div>
		<?php endif ?>
	</div>
</div>
<?php elseif($type == 'blog') : ?>
<div class="storytlr_blog">
	<div class="titbullet"></div>
	<div  class="title entry-title p-name p-summary">
		<?= $this->item->getTitle(); ?> 
	</div>
	<div class="content entry-content e-content">
		<?php 
			$content =  $this->item->getContent();
			$textcontent = strip_tags($content);
			if ($this->summary && strlen($textcontent) > 300) {
				echo "<p>" . substr($textcontent, 0 , 300) . "...</p>";
				echo '<p> <a class="more-link" href="' . $this->base()->thisUrl() . "/entry/" . $this->item->getSlug() . '">read more</a></p>';
			} else {
				echo $content;
			}
		?>
	</div>
</div>
<?php elseif($type == 'status') : ?>	
<div class="storytlr_status">
	<div  class="title entry-title p-name p-summary e-content">
		<?php
		    $title = $this->item->getTitle(); 
			$title = preg_replace("|([[:alpha:]]+://[^[:space:]]+[[:alnum:]/])|",'<a href="\\1" target="_blank">\\1</a>',$title);
			$title = preg_replace("|@([a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+)|",'<a class="h-card" href="http://\\1" target="_blank">@<span class="p-name p-nickname">\\1</span></a>',$title);
			$title = preg_replace("|@([a-zA-Z0-9\-\_]+)|",'<a class="h-card" href="http://twitter.com/\\1" target="_blank">@<span class="p-name p-nickname">\\1</span></a>',$title);			 
			$title = preg_replace("|#([a-zA-Z0-9_]+)|",'<a href="tag/\\1">#\\1</a>',$title); // add tag links
                        $title = nl2br($title);
					
			echo $title;
		?>
	</div>
	<?php if ($this->item->isReply()) :?>
	<footer>
		<p>In reply to <a href="<?= $this->item->getReplyTo() ?>" class="u-in-reply-to"><?= Stuffpress_Services_Webparse::getHost($this->item->getReplyTo()) ?></a></p>
	</footer>
	<?php endif ?>
</div>	
<?php elseif($type == 'link') : ?>	
<div class="storytlr_link">
	<div  class="title entry-title p-name p-summary">
		Shared the link <a href="<?= $this->item->getLink(); ?>"><?= $this->item->getTitle(); ?></a>
	</div>
	<?php if ($this->item->getDescription()) : ?>
		<div class="note entry-content e-content">
			<?= $this->item->getDescription(); ?>
		</div>
	<?php endif ?>
</div>
<?php elseif($type == 'video') : ?>
<div class="storytlr_video">
	<div  class="title entry-title p-name p-summary">
		<?= $this->item->getTitle(); ?>
	</div>
	<div class="entry-content e-content">
		<div class="content">
			<?= $this->item->getVideoPlayer(350, 250); ?>
		</div>
		<?php if ($this->item->getDescription()) : ?>
			<div class="note">
				<?= $this->item->getDescription(); ?>
			</div>
		<?php endif ?>
	</div>
</div>
<?php endif ?>
